﻿using log4net;

[assembly: log4net.Config.XmlConfigurator(ConfigFile = "Log4Net.config", Watch = true)]
namespace Spider.Lib
{
    public class LogHelper
    {
        public static readonly ILog log = LogManager.GetLogger("log4net");
        public static void Info(string message)
        {
            log.Info(message);
        }

        public static void Debug(string message)
        {
            log.Debug(message);
        }

        public static void Fatal(string message)
        {
            log.Fatal(message);
        }

        public static void Warn(string message)
        {
            log.Warn(message);
        }

        public static void Error(string message)
        {
            log.Error(message);
        }

        public static void Error(System.Exception ex)
        {
            log.Error(ex.InnerException == null ? ex.Message : ex.InnerException.Message, ex);
        }
    }
}
